﻿using Microsoft.VisualStudio.TestTools.UnitTesting;
using MySql.Data.MySqlClient;
using System;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
using System.Reflection;
using UA.Data;
using UA.Data.Model;

namespace UAServices.Tests.Data
{
    [TestClass]
    public class UnitTest1
    {
        [TestMethod]
        public void TestMethod1()
        {
            using (UADbContext ctx = new UADbContext())
            {
                ctx.Users.Add(new User { Code = "001", Name = "张三", Password = "123456" });
                ctx.SaveChanges();

                Console.WriteLine(ctx.NDFDatabase.ConnectionString);

                var table = ctx.NDFDatabase.ExecuteDataTable("SELECT name FROM sys.tables");
                foreach (DataRow row in table.Rows)
                {
                    Console.WriteLine(row["name"]);
                }
            }
            //Type type = typeof(MySqlClientFactory);
            //var assembly = Assembly.GetAssembly(type);
            //Console.WriteLine(type.AssemblyQualifiedName);
            //Console.WriteLine(assembly.FullName);
        }
    }
}
